﻿@model Wicresoft.SelfService.DAO.BreakDowmModel
@using Wicresoft.SelfService.DAO

@{
    Layout = null;
}

<script type="text/javascript">
$(function () {

    $("#saveBtn").click(function () { 
        var tier2=$("#Tier2").val();
        var pass=true;
        if(tier2=="")
        {
            alert("提交失败，请输入故障分类信息！");
            pass=false;
        }
        if(pass){
            $.post("@Url.Action("UpdateBreak", "BDMaintain")",$("#breakdownForm").serialize(), 
               function(data){           
                if(data == "true"){
                    alert("保存成功");
                    location.reload(); 
                }
                else{
                    alert("保存失败")
                }
            })
        }

    });

});

</script>

<div class="right_title">故障分类维护</div>
<div class="right_box_top ui-icons">
</div>
<div class="right_box_bg">
    <div class="right_box">
         <div style="padding-bottom: 20px;">
            @using (Html.BeginForm("UpdateBreak", "BDMaintain", FormMethod.Post, new { @id = "breakdownForm" }))
            {
                @Html.HiddenFor(model => model.Tier1ID)
                @Html.HiddenFor(model => model.Tier2ID)
                @Html.HiddenFor(model => model.Tier3ID)
                <table width="600px">
                    <tr align="right">
                        <td style="width: 40%;">
                            <label>故障分类一级:</label>
                        </td>
                        <td>
                            @Html.DropDownListFor(m => Model.Tier1, ViewData["lvl1"] as SelectList, new { id = "Tier1" })
                        </td>
                        <td style="width: 40%;">
                            @if (Model.Tier1ID == 23)
                            {
                                @Html.Label("故障分类三级:");
                            }
                            else
                            {
                                @Html.Label("故障分类二级:");
                            }
                        </td>
                        <td>
                            @Html.EditorFor(model=>model.Tier2,new { id = "Tier2" })
                        </td>
                    </tr>
                    <tr align="left">
                       <td></td>
                       <td></td>
                       <td>
                           <input class="Button1 ui-icons" type="button" id="saveBtn" value="保存" style="margin-left: 45px; margin-top: 20px;" />
                       </td>
                       <td>
                           @*<input class="Button1 ui-icons" type="button" id="deleteBtn" value="删除" style="margin-left: 45px; margin-top: 20px;" />*@
                       </td>
                    </tr>
                </table>
            }
        </div>
    </div>
</div>
<div class="right_box_down ui-icons">
</div>

